<?php 
class companyClassAction extends ActionPlat
{
	public function defaultAction()
	{
		
	}
	
	public function dataAction()
	{
		$limit= (int)$this->get('limit','1');
		$sort = $this->get('sort');
		$dir  = $this->get('dir');
		$order= '`id` desc';
		$dbs  = m('company');
		
		if($sort && $dir)$order= '`'.$sort.'` '.$dir.'';
		$barr = $dbs->getlimit('1=1', (int)$this->get('page','1'),'*',$order, $limit);
		$rows  = $barr['rows'];
		foreach($rows as $k=>$rs)$rows[$k]['logo'] = getface($rs['logo'], $dbs->deflogo);
		$total = count($rows);
		$barr = array(
			'rows' => $rows,
			'totalCount'=> $barr['count'],
			'success' => true,
		);
		return $barr;
	}
	
}